package com.sl.au.service;

import com.sl.au.entity.Account;
import com.sl.au.entity.User;
import com.sl.au.repository.AccountRepository;

import java.util.List;

import org.springframework.data.domain.Sort.Direction;

public interface AccountService extends BaseService {
	AccountRepository getRepository();

	Account login(Account account);

	List<Account> getPage(int start, int length, String key, String orderName, Direction dir);

	Account getAccountData(String name);

	/**
	 * 从视图中账号进行验证，返回一个账号
	 * 
	 * @param username
	 * @param passowrd
	 * @return
	 */
	Account getByUsernameAndPassord(String username, String passowrd);

	int getCount(String key);

	Account findByAccountName(String name);

	void saveAll(Account account, User user);

}
